<%@ Page ClientTarget="uplevel" Language="C#" AutoEventWireup="true" EnableEventValidation="false" ValidateRequest="false" CodeFile="Navigation.aspx.cs" Inherits="Administration_Navigation" MasterPageFile="~/Administration/Admin.master" %>
<%@ MasterType VirtualPath="~/Site.master" %>
<%@ Register TagPrefix="cc1" Namespace="MyWebPagesStarterKit.Controls" %>
<asp:Content ID="contentPane" ContentPlaceHolderID="mainContent" runat="Server">

    <img src="../Images/info.gif" alt="Info" onclick="window.open('../Documentation/<%=lang%>/quick_guide.html#manage-pages','InfoPopUp', 'height=780,width=800,location=no,menubar=no,resizable=yes,scrollbars=yes,status=yes,toolbar=no');return false;"
        style="height: 16px; width: 16px; border-width: 0px; cursor: hand;" />
        
        
    <table border="0" class="navTable" style="width: 500px">
        <tr>
            <td>
            <asp:ListBox runat="server" ID="lstPages" OnSelectedIndexChanged="lstPages_SelectedIndexChanged" AutoPostBack="true" CssClass="sel" Rows="20" Width="250"></asp:ListBox><br />
            <asp:LinkButton CssClass="button" runat="server" ID="btnMovePage" Text="<%$ Resources:stringsRes, adm_Navigation_Move%>" OnClick="MovePageTo" /> 
            <asp:DropDownList runat="server" ID="drpMovePage"></asp:DropDownList> 
            </td>
            <td align="center">
                <asp:Localize ID="LocalizeMoveTitle" runat="server" Visible="false" Text="<%$ Resources:stringsRes, adm_Navigation_Move%>"></asp:Localize><br /><br />
                <table border="1" runat="server" id="tblMoveIcons" visible="false" cellpadding="10">
                    <tr>
                        <td style="width: 33%;">
                        </td>
                        <td style="width: 33%; text-align: center; vertical-align: middle;">
                            <asp:LinkButton ID="btnMoveUp" runat="server" CommandName="up" OnCommand="movePage_Command" SkinID="Up" /></td>
                        <td style="width: 33%;">
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align:right;">
                            <asp:LinkButton ID="btnLevelUp" runat="server" CommandName="left" OnCommand="movePage_Command" SkinID="Left" /></td>
                        <td>
                        </td>
                        <td style="text-align: right; vertical-align: middle;">
                            <asp:LinkButton ID="btnLevelDown" runat="server" CommandName="right" OnCommand="movePage_Command" SkinID="Right" /></td>
                    </tr>
                    <tr>
                        <td>
                        &nbsp;
                        </td>
                        <td style="text-align: center; vertical-align: middle;">
                            <asp:LinkButton ID="btnMoveDown" runat="server" CommandName="down" OnCommand="movePage_Command" SkinID="Down" /></td>
                        <td>
                        </td>
                    </tr>
                  </table><br />
                  <asp:Button runat="server" CssClass="button" ID="btnNewPage" OnClick="btnNewPage_Click" Text="<%$ Resources:stringsRes, adm_Navigation_NewSite%>" />
            </td>
        </tr>
                
    </table>    
        
        
    <table style="width: 620px;" border="0">
        <tr>
            <td colspan="2">
                <table width="100%" runat="server" id="tblPageDetails" visible="false">
                    <tr>
                        <td colspan="2">
                            <hr />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="right"><asp:Button runat="server" CausesValidation="false" ID="copyData" Text="<%$ Resources:stringsRes, adm_Navigation_CopyPageTitle%>" OnClick="CopyData" CssClass="button" />&nbsp;<asp:Button runat="server" ID="btnGotoPage" Text="<%$ Resources:stringsRes, adm_Navigation_GotoPage%>" OnClick="GotoPage" CssClass="button" /></td>
                    </tr>
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_PageTitle%>"></asp:Localize></td>
                        <td class="field">
                            <asp:TextBox runat="server" ID="txtTitle" TextMode="MultiLine" /></td>
                    </tr>
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize ID="Localize3" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_Description%>" />
                        </td>
                        <td class="field">
                            <asp:TextBox runat="server" ID="txtDescription" TextMode="MultiLine" />
                        </td>
                    </tr>
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize ID="Localize4" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_Keywords%>" />
                        </td>
                        <td class="field">
                            <asp:TextBox runat="server" ID="txtKeywords" TextMode="MultiLine" />
                        </td>
                    </tr>
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_Navigation%>"></asp:Localize></td>
                        <td class="field">
                            <asp:TextBox runat="server" ID="txtNavigation"></asp:TextBox>
                        </td>
                    </tr>
                    
                    
                    <tr>
                        <td></td>
                        <td class="field">
                            <asp:CustomValidator runat="server" ID="valVirtualPath" OnServerValidate="valVirtualPath_ServerValidate"
                                Display="dynamic" ErrorMessage="<%$ Resources:stringsRes, adm_Navigation_VirtualPathErrorMessage%>"></asp:CustomValidator></td>
                    </tr>
 
                    
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_VirtualPath%>"></asp:Localize></td>
                        <td class="field">
                            <asp:TextBox runat="server" ID="txtVirtualPath"></asp:TextBox></td>
                    </tr>
                    
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize ID="Localize8" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_LinkPageTo%>"></asp:Localize></td>
                        <td class="field">
                            <asp:DropDownList runat="server" ID="drpLinkedTo"></asp:DropDownList>   
                        </td>
                    </tr>
                    
                    <tr>
                        <td>301 Redirect</td>
                        <td class="field"><asp:TextBox runat="server" ID="txtRedirect301" /></td>
                    </tr>
                    
                    <tr>
                        <td class="fieldlabel"><asp:Localize ID="Localize6" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_Theme%>" /></td>
                        <td class="field"><asp:DropDownList runat="server" ID="drpThemes" AutoPostBack="true" OnSelectedIndexChanged="ChangeTheme"></asp:DropDownList></td>
                    </tr>
                    
                    <tr>
                        <td class="fieldlabel" style="vertical-align:top;"><asp:Localize ID="Localize7" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_PageTemplate%>" /></td>
                        <td class="field">
                            <asp:ListBox runat="server" ID="drpTemplates">
                            </asp:ListBox> <asp:RequiredFieldValidator runat="server" ID="tp" ErrorMessage="<%$ Resources:stringsRes, adm_Navigation_SelectTemplate%>" ControlToValidate="drpTemplates" />
                        </td>
                    </tr>
                    
                    <tr>
                        <td class="fieldlabel"><asp:Localize runat="server" ID="locimg" Text="<%$ Resources:stringsRes, ctl_adm_HeaderImage %>" />
                        
                        </td>
                        <td class="field">
                        
                        <!--Headerimage-->
                        <script type="text/javascript">
                            function SetImage(src) {
                                document.getElementById("<%=txtImage.ClientID%>").value = src;
                                if (document.getElementById(src).style.background == "green")
                                    document.getElementById(src).style.background = "white";
                                else
                                    document.getElementById(src).style.background = "green"
                              
                            }
                         </script>

                        <div id="headerimageslink" style="cursor:pointer"> + </div>
                        <fieldset id="headerimages" style="display:none;width:270px">
                            <ul>
                            <asp:FileUpload runat="server" ID="fileupload" /> <asp:ImageButton ImageUrl="/Images/adm/plus_16.png" runat="server" ID="btnUpload" OnClick="Upload" Text=" + " /><br /><br />
                            <asp:DataList OnItemCommand="Action" runat="server" RepeatColumns="4" RepeatLayout="Table" RepeatDirection="Horizontal"  ID="images" DataKeyField="ID" Width="270">
                                <ItemTemplate>
                                            
                                            <li onclick="SetImage('<%#Eval("FileName","{0}")%>')" class="box" id="<%#Eval("ID","{0}")%>" style="<%#IsSelected(Eval("FileName","{0}"))%>cursor:pointer;float:left;height:72px;width:55px;padding:3px;margin-right: 3px;margin-top:3px;">
                                                
                                                
                                                <div style="height: 42px;" class="screenshot" title="<%#Eval("FileName","{0}")%>" rel="../ImageHandler.ashx?image=~/App_Data/UserImages/Image/HeaderImages/<%#Eval("FileName","{0}")%>&height=500&width=500">
                                                    
                                                    <cc1:ResizedImage MaxHeight="52" ToolTip='<%#Eval("FileName","{0}")%>' MaxWidth="52" ImageUrl='<%#Eval("ImageUrl","{0}")%>' runat="server" />
                                                    
                                                </div>
                                                
                                                
                                                <asp:LinkButton Text="D" runat="server" ID="btnImgDel" CommandName='<%#Eval("FileName","{0}")%>'><img src="/Images/Adm/delete_16.png" style="border:0px;" alt="" /></asp:LinkButton>
                                             </li>
                                </ItemTemplate>        
                            </asp:DataList>
                            <asp:HiddenField runat="server" ID="txtImage" />
                            </ul>
                        </fieldset>
                        <!--Headerimage-->
                        
                        </td>
                    </tr>
                    
                     <tr>
                        <td class="fieldlabel" valign="top">
                            <asp:Localize runat="server" id="locRoles" Text="<%$ Resources:stringsRes, adm_Roles%>" /></td>
                        <td class="field">
                         <asp:ListBox runat="server" ID="RolesList" SelectionMode="Multiple"></asp:ListBox>
                         <asp:CustomValidator ID="OneRoleMinValidator" runat="server" ErrorMessage="CustomValidator" OnServerValidate="CheckMinimumRoles"></asp:CustomValidator>
                        </td>
                    </tr>
                    
                 
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_AllowAnonymous%>"></asp:Localize></td>
                        <td class="field">
                            <asp:CheckBox runat="server" ID="chkAnonymousAccess" /></td>
                    </tr>
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize ID="Localize1" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_EditPowerUser%>"></asp:Localize></td>
                        <td class="field">
                            <asp:CheckBox runat="server" ID="chkEditPowerUser" /></td>
                    </tr>
                    
                     <tr>
                        <td class="fieldlabel">
                            <asp:Localize ID="Localize5" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_Hidden%>"></asp:Localize></td>
                        <td class="field">
                            <asp:CheckBox runat="server" ID="chkHidden" /></td>
                    </tr>
                    
                    
                    <tr>
                        <td class="fieldlabel">
                            <asp:Localize ID="Localize2" runat="server" Text="<%$ Resources:stringsRes, adm_Navigation_Visible%>"></asp:Localize></td>
                        <td class="field">
                            <asp:CheckBox runat="server" ID="chkVisible" /></td>
                    </tr>
                    <tr>
                        <td>
                        </td>
                        <td align="right">
                            <table>
                                <tr>
                                    <td colspan="2">
                                        <asp:Button CssClass="button" runat="server" ID="btnSave" OnClick="btnSave_Click" Text="<%$ Resources:stringsRes, glb__Save%>">
                                        </asp:Button></td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Button runat="Server" CssClass="button" ID="btnSetHomepage" OnClick="btnSetHomepage_Click" Text="<%$ Resources:stringsRes, adm_Navigation_Homepage%>" /></td>
                                    <td>
                                        &nbsp;<asp:Button runat="Server" CssClass="button" ID="btnDelete" OnClick="btnDelete_Click" Text="<%$ Resources:stringsRes, glb__Delete%>" /></td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
